// // 根据天气状况返回对应的图标类名
// export const getIconName = (weather) => {
//     switch (weather) {
//         case "晴":
//             return "icon-qing";
//         case "多云":
//             return "icon-duoyun";
//         case "阴":
//             return "icon-yin";
//         case "小雨":
//             return "icon-xiaoyu";
//         case "中雨":
//             return "icon-zhongyu";
//         case "大雨":
//             return "icon-dayu";
//         case "暴雨":
//             return "icon-baoyudaodabaoyu";
//         case "雷阵雨":
//             return "icon-leizhenyu";
//         case "雾":
//             return "icon-wu";
//         case "霾":
//             return "icon-wumai";
//         case "沙尘":
//             return "icon-shachenbao";
//         case "冰雹":
//             return "icon-tianqi-bingbao";
//         case "雨夹雪":
//             return "icon-yujiaxue";
//         case "小雪":
//             return "icon-xiaoxue";
//         case "中雪":
//             return "icon-zhongxue";
//         case "大雪":
//             return "icon-daxue";
//         case "特大暴雨":
//             return "icon-tedabaoyu";
//         case "大暴雨":
//             return "icon-dabaoyu-tedabaoyu";
//         default:
//             return "icon-qing"; // 默认返回晴天图标
//     }
// };

//优化：使用对象映射
// as const 将对象标记为常量，防止被修改
const WEATHER_ICON = {
    "晴": "icon-qing",
    "多云": "icon-duoyun",
    "阴": "icon-yin",
    "小雨": "icon-xiaoyu",
    "中雨": "icon-zhongyu",
    "大雨": "icon-dayu",
    "暴雨": "icon-baoyudaodabaoyu",
    "雷阵雨": "icon-leizhenyu",
    "雾": "icon-wu",
    "霾": "icon-wumai",
    "沙尘": "icon-shachenbao",
    "冰雹": "icon-tianqi-bingbao",
    "雨夹雪": "icon-yujiaxue",
    "小雪": "icon-xiaoxue",
    "中雪": "icon-zhongxue",
    "大雪": "icon-daxue",
    "特大暴雨": "icon-tedabaoyu",
    "大暴雨": "icon-dabaoyu-tedabaoyu",
};

export const getIconName = (weather) => {
    return WEATHER_ICON[weather] || WEATHER_ICON["默认"];
}
